<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>{% block title %}{% endblock %}</title>
  <link rel="stylesheet" href="{{ url_for('static', filename='layui/css/layui.css') }}">
  <link rel="stylesheet" href="{{ url_for('static', filename='css/login.css') }}">
  <!--加载静态文件-->
  <script type="text/javascript" src="{{ url_for('static', filename='js/jquery.min.js') }}"></script>
  <script type="text/javascript" src="{{ url_for('static', filename='js/popper.min.js') }}"></script>

  <!--bootstrap不需要再次加载-->
  <script type="text/javascript" src="{{ url_for('static', filename='bootstrap_local/js/bootstrap.min.js') }}"></script>
  <style>
          .alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}
          .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}
          .alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}
          .close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}
          .close:focus,.close:hover{color:#000;text-decoration:none;opacity:.75}
          .close:not(:disabled):not(.disabled){cursor:pointer}
          button.close{padding:0;background-color:transparent;border:0;-webkit-appearance:none}
          .close{padding:1rem;margin:-1rem -1rem -1rem auto}
          .alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}


  </style>
</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header layui-bg-cyan">
    <a href="{{ url_for('main.index') }}">
      <img src="{{ url_for('static', filename='image/favicon.png') }}" height="50" width="50"
           style="margin-top:5px;margin-left:5px;">
      <div class="layui-logo" style="margin-left:40px;font-weight:bold;font-size:large">My Server</div>
    </a>
    <ul class="layui-nav layui-layout-right">

      {% if current_user.is_authenticated %}
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="{{ current_user.gravatar(size=18) }}">
          {{ current_user.username }}
        </a>
        <dl class="layui-nav-child">
          <dd><a href="{{ url_for('auth.change_password') }}">Change Password</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="{{ url_for('auth.logout') }}">Log Out</a></li>
      {% else %}
      <li class="layui-nav-item"><a href="{{ url_for('auth.login') }}">Log In</a></li>
      {% endif %}

    </ul>
  </div>
</div>
{% for message in get_flashed_messages() %}
<div class="alert alert-warning">
  <button type="button" class="close" data-dismiss="alert">&times;</button>
  {{ message }}
</div>
{% endfor %}
</div>

{% block body %}
{% endblock %}

<script src="{{ url_for('static', filename='layui/layui.js') }}"></script>
<script type="text/javascript">
    layui.use('form', function () {
        var form = layui.form;

    });


</script>
{% block script %}{% endblock %}
</body>
</html>